//
//  EditBianjiView.m
//  Gxj
//
//  Created by 💋索少杰 on 2017/9/8.
//  Copyright © 2017年 wkq. All rights reserved.
//

#import "EditBianjiView.h"
#import <SDAutoLayout.h>
#import "GXJPrefix.pch"

@implementation EditBianjiView

- (instancetype)initWithFrame:(CGRect)frame{
    if (self = [super initWithFrame:frame]) {
        
        self.backgroundColor=[UIColor whiteColor];
        
        _biaotiText=[[UITextField alloc] initWithFrame:CGRectMake(kWidthScale(10), kHeightScale(64), self.size.width, kHeightScale(60))];
        _biaotiText.placeholder=@"请输入辩论标题";
        
        _biaotiText.textColor=[UIColor blackColor];
        _biaotiText.textAlignment =NSTextAlignmentLeft;
        _biaotiText.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter;
        _biaotiText.font=[UIFont systemFontOfSize:kWidthScale(24)];
        //_biaotiText.backgroundColor=[UIColor orangeColor];
        [self addSubview:_biaotiText];
        
        _xiahuxianView= [[UIImageView alloc] init];//WithFrame:CGRectMake(0, 130, UIScreenWidth, kHeightScale(10))
        _xiahuxianView.image = [UIImage imageNamed:@"hui"];
        [self addSubview:_xiahuxianView];
        
        _xiahuxianView.sd_layout
        .topSpaceToView(_biaotiText, kHeightScale(2))
        .leftEqualToView(self.biaotiText)
        .rightSpaceToView(self, kWidthScale(10))
        .heightIs(kHeightScale(1));
        
        _zhutiText=[[UILabel alloc] init];
        _zhutiText.text=@"请选择辩论主题";
        _zhutiText.textColor=[UIColor blackColor];
        _zhutiText.font=[UIFont systemFontOfSize:kWidthScale(13)];
        //_zhutiText.backgroundColor=[UIColor orangeColor];
        [self addSubview:_zhutiText];
        
        _zhutiText.sd_layout
        .topSpaceToView(self.xiahuxianView, kHeightScale(12))
        .leftSpaceToView(self, kWidthScale(10))
        .widthIs(kWidthScale(130))
        .autoHeightRatio(0);
        
        
        
        _xiahuxianView1= [[UIImageView alloc] init];
        _xiahuxianView1.image = [UIImage imageNamed:@"hui"];
        [self addSubview:_xiahuxianView1];
        
        _xiahuxianView1.sd_layout
        .topSpaceToView(self.zhutiText, kHeightScale(12))
        .leftEqualToView(self.zhutiText)
        .rightSpaceToView(self, kWidthScale(10))
        .heightIs(kHeightScale(1));
        
        NSArray*arr=@[@"shangye",@"fuzhuang",@"UI"];
        for (int i = 0; i < arr.count; i++) {
            _biaoqianIcon = [[UIImageView alloc] initWithFrame:CGRectMake(kWidthScale(115) * (i+1) - (80*i), kHeightScale(140), kWidthScale(35), kHeightScale(15))];
            _biaoqianIcon.image = [UIImage imageNamed:arr[i]];
            [self addSubview:_biaoqianIcon]; //  最佳评论用户头像
        }
        
        _KeywordsText=[[UILabel alloc] init];
        _KeywordsText.text=@"请输入关键词";
        _KeywordsText.textColor=[UIColor blackColor];
        _KeywordsText.font=[UIFont systemFontOfSize:kWidthScale(14)];
        //_KeywordsText.backgroundColor=[UIColor orangeColor];
        [self addSubview:_KeywordsText];
        
        _KeywordsText.sd_layout
        .topSpaceToView(self.xiahuxianView1, kHeightScale(40))
        .leftEqualToView(self.xiahuxianView1)
        .widthIs(kWidthScale(100))
        .autoHeightRatio(0);
        
        //支持  反对
        _zhiChiImage=[[UIImageView alloc] init];
        _zhiChiImage.image=[UIImage imageNamed:@"bianlunfengbao-3"];
        //_zhiChiImage.backgroundColor=[UIColor orangeColor];
        _zhiChiImage.contentMode = UIViewContentModeScaleAspectFit;
        [self addSubview:_zhiChiImage];
        
        _fanDuiImage=[[UIImageView alloc] init];
        _fanDuiImage.image=[UIImage imageNamed:@"bianlunfengbao-3"];
        //_fanDuiImage.backgroundColor=[UIColor orangeColor];
        _fanDuiImage.contentMode = UIViewContentModeScaleAspectFit;
        [self addSubview:_fanDuiImage];
        
        //yes  on  no
        _yes=[[UILabel alloc] init];
        _yes.text=@"早恋";
        _yes.textColor=[UIColor orangeColor];
        _yes.font=[UIFont systemFontOfSize:kWidthScale(14)];
        _yes.textAlignment=YES;
        [_zhiChiImage addSubview:_yes];
        
        _no=[[UILabel alloc] init];
        _no.text=@"晚恋";
        _no.textColor=[UIColor orangeColor];
        _no.font=[UIFont systemFontOfSize:kWidthScale(14)];
        _no.textAlignment=YES;
        [_fanDuiImage addSubview:_no];
        
        _pkImageView=[[UIImageView alloc] init];
        _pkImageView.image=[UIImage imageNamed:@"pk"];
        [self addSubview:_pkImageView];

        _zhiChiImage.sd_layout
        .topSpaceToView(self.xiahuxianView1, kHeightScale(80))
        .leftSpaceToView(self.KeywordsText, kWidthScale(-20))
        .widthIs(kWidthScale(100))
        .heightIs(kHeightScale(100));
        _fanDuiImage.sd_layout
        .topSpaceToView(self.xiahuxianView1, kHeightScale(80))
        .leftSpaceToView(self.zhiChiImage, kWidthScale(30))
        .widthIs(kWidthScale(100))
        .heightIs(kHeightScale(100));
        _pkImageView.sd_layout
        .topSpaceToView(self.xiahuxianView, kHeightScale(160))
        .leftSpaceToView(self.zhiChiImage, kWidthScale(-6))
        .widthIs(kWidthScale(40))
        .heightIs(kHeightScale(20));
        
        
        //早恋  晚恋  文字
        _yes.sd_layout
        .widthIs(kWidthScale(100))
        .heightIs(kHeightScale(90));
        
        _no.sd_layout
        .widthIs(kWidthScale(100))
        .heightIs(kHeightScale(90));
        
        
    }
    return self;
}

@end
